<template>
	<view class="px-2">
		<uni-nav-bar left-icon="back" statusBar :border="false" @click-left="goBack">
			<view class="flex align-center justify-center w-100" @click="changeIsopen">
				<text>{{isopenText}}</text>
				<text class="iconfont icon-shezhi ml-2"></text>
			</view>
		</uni-nav-bar>
		<textarea class="uni-textarea px-2"  v-model="content" placeholder="说一句话吧~" />
		<view class="choose-btn flex align-center justify-center rounded-circle text-main" hover-class="bg-light">
			<text class="iconfont icon-caidan"></text>
			<text class="ml-2">请选择分类</text>
		</view>
		<view class="choose-btn flex align-center justify-center rounded-circle text-main mt-3" hover-class="bg-light">
			<text class="iconfont icon-huati"></text>
			<text class="ml-2">请选择话题</text>
		</view>
		<uploadImg />
		<view class="fixed-bottom ">
			<view class="flex align-center justify-between py-2">
				<view class="flex align-center ">
					<view class="px-2" hover-class="bg-light">
						<text class="iconfont icon-caidan" style="font-size: 45rpx;"></text>
					</view>
					<view class="px-2" hover-class="bg-light">
						<text class="iconfont icon-huati" style="font-size: 45rpx;"></text>
					</view>
					<view class="px-2" hover-class="bg-light">
						<text class="iconfont icon-tupian" style="font-size: 45rpx;"></text>
					</view>
				</view>
				<button class="send-btn rounded flex align-center justify-center bg-main text-white ml-auto font-sm " type="default">
					发送
				</button>
			</view>
		</view>
	</view>
</template>

<script>
	import uniNavBar from '@/components/uni-ui/uni-nav-bar/uni-nav-bar.vue'
	import uploadImg from '@/components/common/upload-img.vue'
	const isOpenArray = ['仅自己可见','所有人可见']
	export default {
		components:{
			uniNavBar,
			uploadImg
		},
		computed:{
			isopenText(){
				return isOpenArray[this.isopen]
			},
		},
		data() {
			return {
				content:'',
				isopen:1
			};
		},
		methods:{
			goBack() {
				uni.navigateBack({delta:1})
			},
			changeIsopen() {
				uni.showActionSheet({
				    itemList: isOpenArray,
				    success: (res)=> {
				        this.isopen = res.tapIndex
				    }
				});
			}
		}
	}
</script>

<style lang="scss">
.choose-btn {
	width: 238rpx;
	height: 74rpx;
	border: 1rpx solid #FF4A6A;
}
.send-btn {
	width: 158rpx;
	height: 54rpx;
}
</style>
